<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>라디오박스</title>
<script language="JavaScript">
function mclick(f){
l=f.chk.length
for(i=0 ; i < l ; ++i){
if(f.chk[i].checked){
f.re.style.backgroundColor=f.chk[i].value
f.re.value=f.chk[i].value}
}
}
</script>
</head>
<body>
<form name=ff>
<table border=0>
<th><center>Box의 색상을 고르시요</center></th>
<tr>
<td>
<textarea name=re rows=5 cols=30 ></textarea>
</td></tr><tr>
<td>
<label><input type="radio" name=chk value="#330000">검정</label>
<label><input type="radio" name=chk value="#3300FF">파랑</label>
<label><input type="radio" name=chk value="#00FF00">녹색</label>
<label><input type="radio" name=chk value="#FF0000">빨강</label><br>
<label><input type="radio" name=chk value="#FFFF00">노랑</label>
<label><input type="radio" name=chk value="#FFFFFF">흰색</label>
<label><input type="radio" name=chk value="#FF9900">오랜지</label>
<input type=button name=bu value="click" onclick="mclick(this.form)">
</td>
</tr>
</table>
</form>
</body>
</html>